(function (c, b, a, e) {
    var d = c(b);
    c.fn.lazyload = function (f) {
        var h = this;
        var i;
        var t;
        var g = {
            threshold: 0,
            failure_limit: 0,
            event: "scroll",
            effect: "show",
            throttle: 300,
            container: b,
            data_attribute: "src",
            skip_invisible: true,
            appear: null,
            load: null,
            placeholder: ""
        };

        function j() {
            var k = 0;
            h.each(function () {
                var l = c(this);
                if (g.skip_invisible && !l.is(":visible")) {
                    return
                }
                if (c.abovethetop(this, g) || c.leftofbegin(this, g)) {
                } else {
                    if (!c.belowthefold(this, g) && !c.rightoffold(this, g)) {
                        l.trigger("appear");
                        k = 0
                    } else {
                        if (++k > g.failure_limit) {
                            return false
                        }
                    }
                }
            })
        }

        if (f) {
            if (e !== f.failurelimit) {
                f.failure_limit = f.failurelimit;
                delete f.failurelimit
            }
            if (e !== f.effectspeed) {
                f.effect_speed = f.effectspeed;
                delete f.effectspeed
            }
            c.extend(g, f)
        }
        i = (g.container === e || g.container === b) ? d : c(g.container);
        if (0 === g.event.indexOf("scroll")) {
            i.bind(g.event, function () {
                if (t) {
                    clearTimeout(t)
                }
                return t = setTimeout(j, g.throttle)
            })
        }
        this.each(function () {
            var k = this;
            var l = c(k);
            k.loaded = false;
            if (l.attr("src") === e || l.attr("src") === false) {
                if (l.is("img")) {
                    l.attr("src", g.placeholder)
                }
            }
            l.one("appear", function () {
                if (!this.loaded) {
                    if (g.appear) {
                        var m = h.length;
                        g.appear.call(k, m, g)
                    }
                    var o = l.attr("data-" + g.data_attribute);
                    if (l.is("img")) {
                        l.attr("src", o)
                    } else {
                        l.css("background-image", "url(" + o + ")")
                    }
                    k.loaded = true;
                    var n = c.grep(h, function (q) {
                        return !q.loaded
                    });
                    h = c(n);
                    if (g.load) {
                        var p = h.length;
                        g.load.call(k, p, g)
                    }
                }
            });
            if (0 !== g.event.indexOf("scroll")) {
                l.bind(g.event, function () {
                    if (!k.loaded) {
                        l.trigger("appear")
                    }
                })
            }
        });
        d.bind("resize", function () {
            j()
        });
        if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) {
            d.bind("pageshow", function (k) {
                if (k.originalEvent && k.originalEvent.persisted) {
                    h.each(function () {
                        c(this).trigger("appear")
                    })
                }
            })
        }
        c(a).ready(function () {
            j()
        });
        return this
    };
    c.belowthefold = function (g, h) {
        var f;
        if (h.container === e || h.container === b) {
            f = (b.innerHeight ? b.innerHeight : d.height()) + d.scrollTop()
        } else {
            f = c(h.container).offset().top + c(h.container).height()
        }
        return f <= c(g).offset().top - h.threshold
    };
    c.rightoffold = function (g, h) {
        var f;
        if (h.container === e || h.container === b) {
            f = d.width() + d.scrollLeft()
        } else {
            f = c(h.container).offset().left + c(h.container).width()
        }
        return f <= c(g).offset().left - h.threshold
    };
    c.abovethetop = function (g, h) {
        var f;
        if (h.container === e || h.container === b) {
            f = d.scrollTop()
        } else {
            f = c(h.container).offset().top
        }
        return f >= c(g).offset().top + h.threshold + c(g).height()
    };
    c.leftofbegin = function (g, h) {
        var f;
        if (h.container === e || h.container === b) {
            f = d.scrollLeft()
        } else {
            f = c(h.container).offset().left
        }
        return f >= c(g).offset().left + h.threshold + c(g).width()
    };
    c.inviewport = function (f, g) {
        return !c.rightoffold(f, g) && !c.leftofbegin(f, g) && !c.belowthefold(f, g) && !c.abovethetop(f, g)
    };
    c.extend(c.expr[":"], {
        "below-the-fold": function (f) {
            return c.belowthefold(f, {
                threshold: 0
            })
        },
        "above-the-top": function (f) {
            return !c.belowthefold(f, {
                threshold: 0
            })
        },
        "right-of-screen": function (f) {
            return c.rightoffold(f, {
                threshold: 0
            })
        },
        "left-of-screen": function (f) {
            return !c.rightoffold(f, {
                threshold: 0
            })
        },
        "in-viewport": function (f) {
            return c.inviewport(f, {
                threshold: 0
            })
        },
        "above-the-fold": function (f) {
            return !c.belowthefold(f, {
                threshold: 0
            })
        },
        "right-of-fold": function (f) {
            return c.rightoffold(f, {
                threshold: 0
            })
        },
        "left-of-fold": function (f) {
            return !c.rightoffold(f, {
                threshold: 0
            })
        }
    })
})(jQuery, window, document);

!function () {
    var _996nav = _996nav || {};
    _996nav.lzImg = function (imgs) {
        if (imgs === undefined) {
            imgs = jQuery("img.lazy");
        }
        imgs.lazyload({
            threshold: 100,
            failure_limit: 10,
            effect: "fadeIn",
            throttle: 50,
            effect_speed: 100,
            skip_invisible: true,
            load: function () {
            }
        });
    };
    _996nav.init = function () {
        _996nav.lzImg();
    };
    jQuery(function () {
        _996nav.init();
    });
    var $scroll_obj = $('#btn-scrollup');
    $(window).on('scroll', function () {
        if ($(this).scrollTop() > 100) {
            $scroll_obj.fadeIn();
        } else {
            $scroll_obj.fadeOut();
        }
    });

    // $scroll_obj.on('click', function() {
    //     $('html, body').animate({
    //         scrollTop: 0
    //     }, 600);
    //     return false;
    // });

    for (j = 0; j < arr.length; j++) {
        for (i = 0; i < arr[j].length; i++) {
            var newDiv = document.createElement('div');
            var num = Math.floor(Math.random() * 1000);
            newDiv.className = "col-xs-12 col-sm-6 col-md-3 col-lg-2 website";
            newDiv.innerHTML =
                '<a href="' + arr[j][i].href + '" title="' + arr[j][i].name + '" target="_blank" >' +
                '<img class="lazy website_logo"  src="/static/plugins/tool_website/images/lazy.png" data-src="' + arr[j][i].logo + '" alt="">' +
                ' <div class="website_introduce">' +
                '<h3 class="website_name">' + arr[j][i].name + '<em>' + num + '</em>' + '</h3>' +
                '<p class="website_keywords">' + arr[j][i].detail + '</p>' +
                '</div>' +
                '</a>'
            $(".main").eq(j).append(newDiv);
        }
        ;
    }
    ;
    $(window).scroll(function () {
        var _top = $(this).scrollTop();

        if (_top > 0) {
            $(".siderBar").fadeIn();
        } else {
            $(".siderBar").fadeOut();
        }
        ;
        var obj = $(".container .site");

        obj.each(function () {
            var i = $(this).index() - 1;
            var _h = obj.eq(i).offset().top + $(this).height() / 2;
            if (_top < _h) {
                $(".floor ul li").eq(i).find("span").addClass("active").parent().siblings().find("span").removeClass("active");
                return false;
            }
        });
    });


    $(".floor ul li").click(function () {
        $(this).find("span").addClass("active").parent().siblings().find('span').removeClass();
        var _index = $(this).index();
        var _height = $(".container .site").eq(_index).offset().top + 15;
        $("body,html").animate({
            scrollTop: _height
        }, 500);
    });
    $('.siderBar .top').click(function () {
        $('html, body').animate({
            scrollTop: 0
        }, 600);
    })
    $(".siderBar .shejiao").hover(function () {
        $(this).children().show(100);
    }, function () {
        $(this).children().hide(500);

    });

}();


var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?d50bffcfa093581a686b59b87f5d917f";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();


!function () {
    function g() {
        h(), i(), j(), k()
    }

    function h() {
        d.checked = s()
    }

    function i() {
        var a = document.querySelector('input[name="type"][value="' + p() + '"]');
        a && (a.checked = !0, l(a))
    }

    function j() {
        v(u())
    }

    function k() {
        w(t())
    }

    function l(a) {
        for (var b = 0; b < e.length; b++) e[b].classList.remove("s-current");
        a.parentNode.parentNode.parentNode.classList.add("s-current")
    }

    function m(a, b) {
        window.localStorage.setItem("superSearch" + a, b)
    }

    function n(a) {
        return window.localStorage.getItem("superSearch" + a)
    }

    function o(a) {
        f = a.target, v(u()), w(a.target.value), m("type", a.target.value), c.focus(), l(a.target)
    }

    function p() {
        var b = n("type");
        return b || a[0].value
    }

    function q(a) {
        m("newWindow", a.target.checked ? 1 : -1), x(a.target.checked)
    }

    function r(a) {
        return a.preventDefault(), "" == c.value ? (c.focus(), !1) : (w(t() + c.value), x(s()), s() ? window.open(b.action, +new Date) : location.href = b.action, void 0)
    }

    function s() {
        var a = n("newWindow");
        return a ? 1 == a : !0
    }

    function t() {
        return document.querySelector('input[name="type"]:checked').value
    }

    function u() {
        return document.querySelector('input[name="type"]:checked').getAttribute("data-placeholder")
    }

    function v(a) {
        c.setAttribute("placeholder", a)
    }

    function w(a) {
        b.action = a
    }

    function x(a) {
        a ? b.target = "_blank" : b.removeAttribute("target")
    }

    var y, a = document.querySelectorAll('input[name="type"]'),
        b = document.querySelector("#super-search-fm"),
        c = document.querySelector("#search-text"),
        d = document.querySelector("#set-search-blank"),
        e = document.querySelectorAll(".search-group"),
        f = a[0];
    for (g(), y = 0; y < a.length; y++) a[y].addEventListener("change", o);
    d.addEventListener("change", q), b.addEventListener("submit", r)
}();